<?php
require('includes/top.php');


$designation = $_POST['designation'];
$description = $_POST['description'];

$query = "SELECT * FROM designation WHERE `designation_name` = '".trim($designation)."'";
$result = mysql_query($query);
if ( mysql_num_rows ( $result )> 0 )
{
    header("location: add_designation?v=err");
}
else
 {
$sql1="INSERT INTO designation(`designation_name`,`description`) VALUES ('$designation','$description')";
$result1=mysql_query($sql1);
}

if($result1>0)
{
header('Location: add_designation.php?v=success');
}
else
{
header('Location: add_designation.php?v=err');
}
?>